//
//  WCEditIncludeDirectoriesTableView.m
//  WabbitCode
//
//  Created by William Towe on 4/10/09.
//  Copyright 2009 Revolution Software. All rights reserved.
//

#import "WCEditIncludeDirectoriesTableView.h"
#import "WCMacros.h"


NSString *kWCEditIncludeDirectoriesTableViewPboardType = @"kWCEditIncludeDirectoriesTableViewPboardType";

@implementation WCEditIncludeDirectoriesTableView
- (void)awakeFromNib {
	[self registerForDraggedTypes:[NSArray arrayWithObjects:kWCEditIncludeDirectoriesTableViewPboardType, NSFilenamesPboardType, nil]];
	[self setDraggingSourceOperationMask:NSDragOperationMove forLocal:YES];
	[self setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
}

- (void)keyDown:(NSEvent *)event {
	switch ([event keyCode]) {
		case kKeyCodeDelete:
		case kKeyCodeForwardDelete:
			if ([[self dataSource] canRemove])
				[[self dataSource] remove:nil];
			else
				NSBeep();
			return;
		default:
			break;
	}
	[super keyDown:event];
}
@end
